#include<iostream>
int main()
{
	char c;
	int w=0,v=0,n=0,o=0;
	while((c=getchar())!='\n')
	{
		if(c>='a'&&c<='z')
			w++;
		else if(c>='0'&&c<='9')
			n++;
		else if(c==' ')
			v++;
		else
			o++;
	}
	printf("%d %d %d %d\n",w,n,v,o);
	system("pause");
	return 0;
}
